<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/31 0031
 * Time: 上午 10:22
 */

namespace app\admin\controller;

use app\admin\model\User as A;


class User extends  Common
{
    private $PageTitle ;
    //实例化model
    protected $db;
    protected function _initialize()
    {
        parent::_initialize();
        $this->db= new A();
    }
    public function index()
    {
        $allData=$this->db->getAllData();
        $this->assign('allData',$allData);
        $this->PageTitle='用户管理';
        $this->generalInfor($this->PageTitle);
        return $this->fetch();
    }
        public function address()
        {
            $id=input('param.user_id');
            if($id=="")
            {
                $this->redirect('user/index');
            }
            $allData=$this->db->getUserAddr($id);
            //halt($allData);
            $this->assign('allData',$allData);
            $this->PageTitle='用户收货地址';
            $this->generalInfor($this->PageTitle);
           return $this->fetch();
        }
        public function user_account()
        {

            $id=input('param.user_id');
            if($id=="")
            {
                $this->redirect('user/index');
            }
            $allData=$this->db->getUserBill($id);
            $this->assign('allData',$allData);
            $this->PageTitle='用户账单流水';
            $this->generalInfor($this->PageTitle);
            return $this->fetch();
        }
}